Optimal. Leaf size=277 \[ -\frac {B (b c-a d)}{3 (b f-a g) (d f-c g) (f+g x)^2}-\frac {2 B (b c-a d) (2 b d f-b c g-a d g)}{3 (b f-a g)^2 (d f-c g)^2 (f+g x)}+\frac {2 b^3 B \log (a+b x)}{3 g (b f-a g)^3}-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{3 g (f+g x)^3}-\frac {2 B d^3 \log (c+d x)}{3 g (d f-c g)^3}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) \log (f+g x)}{3 (b f-a g)^3 (d f-c g)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 277, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2548, 84}
\begin {gather*} \frac {2 B (b c-a d) \log (f+g x) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (c^2 g^2-3 c d f g+3 d^2 f^2\right )\right )}{3 (b f-a g)^3 (d f-c g)^3}-\frac {B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A}{3 g (f+g x)^3}+\frac {2 b^3 B \log (a+b x)}{3 g (b f-a g)^3}-\frac {2 B (b c-a d) (-a d g-b c g+2 b d f)}{3 (f+g x) (b f-a g)^2 (d f-c g)^2}-\frac {B (b c-a d)}{3 (f+g x)^2 (b f-a g) (d f-c g)}-\frac {2 B d^3 \log (c+d x)}{3 g (d f-c g)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 84
Rule 2548
Rubi steps
\begin {align*} \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(f+g x)^4} \, dx &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{3 g (f+g x)^3}+\frac {B \int \frac {2 (b c-a d)}{(a+b x) (c+d x) (f+g x)^3} \, dx}{3 g}\\ &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{3 g (f+g x)^3}+\frac {(2 B (b c-a d)) \int \frac {1}{(a+b x) (c+d x) (f+g x)^3} \, dx}{3 g}\\ &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{3 g (f+g x)^3}+\frac {(2 B (b c-a d)) \int \left (\frac {b^4}{(b c-a d) (b f-a g)^3 (a+b x)}+\frac {d^4}{(b c-a d) (-d f+c g)^3 (c+d x)}+\frac {g^2}{(b f-a g) (d f-c g) (f+g x)^3}-\frac {g^2 (-2 b d f+b c g+a d g)}{(b f-a g)^2 (d f-c g)^2 (f+g x)^2}+\frac {g^2 \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right )}{(b f-a g)^3 (d f-c g)^3 (f+g x)}\right ) \, dx}{3 g}\\ &=-\frac {B (b c-a d)}{3 (b f-a g) (d f-c g) (f+g x)^2}-\frac {2 B (b c-a d) (2 b d f-b c g-a d g)}{3 (b f-a g)^2 (d f-c g)^2 (f+g x)}+\frac {2 b^3 B \log (a+b x)}{3 g (b f-a g)^3}-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{3 g (f+g x)^3}-\frac {2 B d^3 \log (c+d x)}{3 g (d f-c g)^3}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) \log (f+g x)}{3 (b f-a g)^3 (d f-c g)^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.47, size = 263, normalized size = 0.95 \begin {gather*} \frac {-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(f+g x)^3}+2 B (b c-a d) \left (-\frac {g}{2 (b f-a g) (d f-c g) (f+g x)^2}+\frac {g (-2 b d f+b c g+a d g)}{(b f-a g)^2 (d f-c g)^2 (f+g x)}+\frac {b^3 \log (a+b x)}{(b c-a d) (b f-a g)^3}+\frac {d^3 \log (c+d x)}{(b c-a d) (-d f+c g)^3}+\frac {g \left (a^2 d^2 g^2+a b d g (-3 d f+c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) \log (f+g x)}{(b f-a g)^3 (d f-c g)^3}\right )}{3 g} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(2562\) vs.
\(2(268)=536\).
time = 0.88, size = 2563, normalized size = 9.25
method | result | size |
risch | \(\text {Expression too large to display}\) | \(2293\) |
derivativedivides | \(\text {Expression too large to display}\) | \(2563\) |
default | \(\text {Expression too large to display}\) | \(2563\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 903 vs.
\(2 (266) = 532\).
time = 0.36, size = 903, normalized size = 3.26 \begin {gather*} \frac {1}{3} \, {\left (\frac {2 \, b^{3} \log \left (b x + a\right )}{b^{3} f^{3} g - 3 \, a b^{2} f^{2} g^{2} + 3 \, a^{2} b f g^{3} - a^{3} g^{4}} - \frac {2 \, d^{3} \log \left (d x + c\right )}{d^{3} f^{3} g - 3 \, c d^{2} f^{2} g^{2} + 3 \, c^{2} d f g^{3} - c^{3} g^{4}} + \frac {2 \, {\left (3 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} f^{2} - 3 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} f g + {\left (b^{3} c^{3} - a^{3} d^{3}\right )} g^{2}\right )} \log \left (g x + f\right )}{b^{3} d^{3} f^{6} + a^{3} c^{3} g^{6} - 3 \, {\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} f^{5} g + 3 \, {\left (b^{3} c^{2} d + 3 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} f^{4} g^{2} - {\left (b^{3} c^{3} + 9 \, a b^{2} c^{2} d + 9 \, a^{2} b c d^{2} + a^{3} d^{3}\right )} f^{3} g^{3} + 3 \, {\left (a b^{2} c^{3} + 3 \, a^{2} b c^{2} d + a^{3} c d^{2}\right )} f^{2} g^{4} - 3 \, {\left (a^{2} b c^{3} + a^{3} c^{2} d\right )} f g^{5}} - \frac {5 \, {\left (b^{2} c d - a b d^{2}\right )} f^{2} - 3 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} f g + {\left (a b c^{2} - a^{2} c d\right )} g^{2} + 2 \, {\left (2 \, {\left (b^{2} c d - a b d^{2}\right )} f g - {\left (b^{2} c^{2} - a^{2} d^{2}\right )} g^{2}\right )} x}{b^{2} d^{2} f^{6} + a^{2} c^{2} f^{2} g^{4} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} f^{5} g + {\left (b^{2} c^{2} + 4 \, a b c d + a^{2} d^{2}\right )} f^{4} g^{2} - 2 \, {\left (a b c^{2} + a^{2} c d\right )} f^{3} g^{3} + {\left (b^{2} d^{2} f^{4} g^{2} + a^{2} c^{2} g^{6} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} f^{3} g^{3} + {\left (b^{2} c^{2} + 4 \, a b c d + a^{2} d^{2}\right )} f^{2} g^{4} - 2 \, {\left (a b c^{2} + a^{2} c d\right )} f g^{5}\right )} x^{2} + 2 \, {\left (b^{2} d^{2} f^{5} g + a^{2} c^{2} f g^{5} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} f^{4} g^{2} + {\left (b^{2} c^{2} + 4 \, a b c d + a^{2} d^{2}\right )} f^{3} g^{3} - 2 \, {\left (a b c^{2} + a^{2} c d\right )} f^{2} g^{4}\right )} x} - \frac {\log \left (\frac {b^{2} x^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b x e}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{g^{4} x^{3} + 3 \, f g^{3} x^{2} + 3 \, f^{2} g^{2} x + f^{3} g}\right )} B - \frac {A}{3 \, {\left (g^{4} x^{3} + 3 \, f g^{3} x^{2} + 3 \, f^{2} g^{2} x + f^{3} g\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1391 vs.
\(2 (266) = 532\).
time = 2.35, size = 1391, normalized size = 5.02 \begin {gather*} \frac {2 \, B b^{4} \log \left ({\left | b x + a \right |}\right )}{3 \, {\left (b^{4} f^{3} g - 3 \, a b^{3} f^{2} g^{2} + 3 \, a^{2} b^{2} f g^{3} - a^{3} b g^{4}\right )}} - \frac {2 \, B d^{4} \log \left ({\left | d x + c \right |}\right )}{3 \, {\left (d^{4} f^{3} g - 3 \, c d^{3} f^{2} g^{2} + 3 \, c^{2} d^{2} f g^{3} - c^{3} d g^{4}\right )}} + \frac {2 \, {\left (3 \, B b^{3} c d^{2} f^{2} - 3 \, B a b^{2} d^{3} f^{2} - 3 \, B b^{3} c^{2} d f g + 3 \, B a^{2} b d^{3} f g + B b^{3} c^{3} g^{2} - B a^{3} d^{3} g^{2}\right )} \log \left (g x + f\right )}{3 \, {\left (b^{3} d^{3} f^{6} - 3 \, b^{3} c d^{2} f^{5} g - 3 \, a b^{2} d^{3} f^{5} g + 3 \, b^{3} c^{2} d f^{4} g^{2} + 9 \, a b^{2} c d^{2} f^{4} g^{2} + 3 \, a^{2} b d^{3} f^{4} g^{2} - b^{3} c^{3} f^{3} g^{3} - 9 \, a b^{2} c^{2} d f^{3} g^{3} - 9 \, a^{2} b c d^{2} f^{3} g^{3} - a^{3} d^{3} f^{3} g^{3} + 3 \, a b^{2} c^{3} f^{2} g^{4} + 9 \, a^{2} b c^{2} d f^{2} g^{4} + 3 \, a^{3} c d^{2} f^{2} g^{4} - 3 \, a^{2} b c^{3} f g^{5} - 3 \, a^{3} c^{2} d f g^{5} + a^{3} c^{3} g^{6}\right )}} - \frac {B \log \left (\frac {b^{2} x^{2} + 2 \, a b x + a^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{3 \, {\left (g^{4} x^{3} + 3 \, f g^{3} x^{2} + 3 \, f^{2} g^{2} x + f^{3} g\right )}} - \frac {4 \, B b^{2} c d f g^{3} x^{2} - 4 \, B a b d^{2} f g^{3} x^{2} - 2 \, B b^{2} c^{2} g^{4} x^{2} + 2 \, B a^{2} d^{2} g^{4} x^{2} + 9 \, B b^{2} c d f^{2} g^{2} x - 9 \, B a b d^{2} f^{2} g^{2} x - 5 \, B b^{2} c^{2} f g^{3} x + 5 \, B a^{2} d^{2} f g^{3} x + B a b c^{2} g^{4} x - B a^{2} c d g^{4} x + A b^{2} d^{2} f^{4} + B b^{2} d^{2} f^{4} - 2 \, A b^{2} c d f^{3} g + 3 \, B b^{2} c d f^{3} g - 2 \, A a b d^{2} f^{3} g - 7 \, B a b d^{2} f^{3} g + A b^{2} c^{2} f^{2} g^{2} - 2 \, B b^{2} c^{2} f^{2} g^{2} + 4 \, A a b c d f^{2} g^{2} + 4 \, B a b c d f^{2} g^{2} + A a^{2} d^{2} f^{2} g^{2} + 4 \, B a^{2} d^{2} f^{2} g^{2} - 2 \, A a b c^{2} f g^{3} - B a b c^{2} f g^{3} - 2 \, A a^{2} c d f g^{3} - 3 \, B a^{2} c d f g^{3} + A a^{2} c^{2} g^{4} + B a^{2} c^{2} g^{4}}{3 \, {\left (b^{2} d^{2} f^{4} g^{4} x^{3} - 2 \, b^{2} c d f^{3} g^{5} x^{3} - 2 \, a b d^{2} f^{3} g^{5} x^{3} + b^{2} c^{2} f^{2} g^{6} x^{3} + 4 \, a b c d f^{2} g^{6} x^{3} + a^{2} d^{2} f^{2} g^{6} x^{3} - 2 \, a b c^{2} f g^{7} x^{3} - 2 \, a^{2} c d f g^{7} x^{3} + a^{2} c^{2} g^{8} x^{3} + 3 \, b^{2} d^{2} f^{5} g^{3} x^{2} - 6 \, b^{2} c d f^{4} g^{4} x^{2} - 6 \, a b d^{2} f^{4} g^{4} x^{2} + 3 \, b^{2} c^{2} f^{3} g^{5} x^{2} + 12 \, a b c d f^{3} g^{5} x^{2} + 3 \, a^{2} d^{2} f^{3} g^{5} x^{2} - 6 \, a b c^{2} f^{2} g^{6} x^{2} - 6 \, a^{2} c d f^{2} g^{6} x^{2} + 3 \, a^{2} c^{2} f g^{7} x^{2} + 3 \, b^{2} d^{2} f^{6} g^{2} x - 6 \, b^{2} c d f^{5} g^{3} x - 6 \, a b d^{2} f^{5} g^{3} x + 3 \, b^{2} c^{2} f^{4} g^{4} x + 12 \, a b c d f^{4} g^{4} x + 3 \, a^{2} d^{2} f^{4} g^{4} x - 6 \, a b c^{2} f^{3} g^{5} x - 6 \, a^{2} c d f^{3} g^{5} x + 3 \, a^{2} c^{2} f^{2} g^{6} x + b^{2} d^{2} f^{7} g - 2 \, b^{2} c d f^{6} g^{2} - 2 \, a b d^{2} f^{6} g^{2} + b^{2} c^{2} f^{5} g^{3} + 4 \, a b c d f^{5} g^{3} + a^{2} d^{2} f^{5} g^{3} - 2 \, a b c^{2} f^{4} g^{4} - 2 \, a^{2} c d f^{4} g^{4} + a^{2} c^{2} f^{3} g^{5}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.58, size = 1147, normalized size = 4.14 \begin {gather*} \frac {\ln \left (f+g\,x\right )\,\left (g\,\left (6\,B\,a^2\,b\,d^3\,f-6\,B\,b^3\,c^2\,d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a^2\,d^2\,g^4-2\,B\,f\,a\,b\,d^2\,g^3-B\,b^2\,c^2\,g^4+2\,B\,f\,b^2\,c\,d\,g^3\right )}{a^2\,c^2\,g^4-2\,a^2\,c\,d\,f\,g^3+a^2\,d^2\,f^2\,g^2-2\,a\,b\,c^2\,f\,g^3+4\,a\,b\,c\,d\,f^2\,g^2-2\,a\,b\,d^2\,f^3\,g+b^2\,c^2\,f^2\,g^2-2\,b^2\,c\,d\,f^3\,g+b^2\,d^2\,f^4}+\frac {x\,\left (-B\,a^2\,c\,d\,g^4+5\,B\,a^2\,d^2\,f\,g^3+B\,a\,b\,c^2\,g^4-9\,B\,a\,b\,d^2\,f^2\,g^2-5\,B\,b^2\,c^2\,f\,g^3+9\,B\,b^2\,c\,d\,f^2\,g^2\right )}{a^2\,c^2\,g^4-2\,a^2\,c\,d\,f\,g^3+a^2\,d^2\,f^2\,g^2-2\,a\,b\,c^2\,f\,g^3+4\,a\,b\,c\,d\,f^2\,g^2-2\,a\,b\,d^2\,f^3\,g+b^2\,c^2\,f^2\,g^2-2\,b^2\,c\,d\,f^3\,g+b^2\,d^2\,f^4}}{3\,f^3\,g+9\,f^2\,g^2\,x+9\,f\,g^3\,x^2+3\,g^4\,x^3}-\frac {B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2}\right )}{3\,g\,\left (f^3+3\,f^2\,g\,x+3\,f\,g^2\,x^2+g^3\,x^3\right )}-\frac {2\,B\,b^3\,\ln \left (a+b\,x\right )}{3\,a^3\,g^4-9\,a^2\,b\,f\,g^3+9\,a\,b^2\,f^2\,g^2-3\,b^3\,f^3\,g}+\frac {2\,B\,d^3\,\ln \left (c+d\,x\right )}{3\,c^3\,g^4-9\,c^2\,d\,f\,g^3+9\,c\,d^2\,f^2\,g^2-3\,d^3\,f^3\,g} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________